/*
 * @Author: kenan
 * @Date: 2022-05-17 17:19:20
 * @LastEditors: kenan
 * @LastEditTime: 2022-05-19 16:08:02
 * @FilePath: /smartide-server/web/src/api/ssh.js
 * @Description: 
 * 
 * Copyright (c) 2022 by kenanlu@leansoftx.com, All Rights Reserved. 
 */
const {
  generateKeyPair
} = await import('crypto');

export const generateSHHKeyPair = async () => {
  generateKeyPair('rsa', {
    modulusLength: 4096,
    publicKeyEncoding: {
      type: 'spki',
      format: 'pem'
    },
    privateKeyEncoding: {
      type: 'pkcs8',
      format: 'pem',
      cipher: 'aes-256-cbc',
      passphrase: 'top secret'
    }
  }, (err, publicKey, privateKey) => {
    // Handle errors and use the generated key pair.
    console.log(111)
  })
}